package org.brisling.task.service;

import org.brisling.common.SysConfig;
import org.brisling.supply.service.SupplyMonitorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class supplyScheduledService {
	private static Logger logger = LoggerFactory.getLogger(ScheduledService.class);
	// @Scheduled(cron="0/5 * *  * * ? ")   //每5秒执行一次  

	@Autowired
	private SupplyMonitorService autocarry;
	
	
	@Scheduled(cron="0 35 1  ? *  MON")
	public void antiDoseCounts(){
		//禁用日志
		SysConfig.setEnableLog(false);
		System.out.println("\n\n\nhaha, A      got one autocarry\n\n\n");
		autocarry.countAndInsertA();
		System.out.println("\n\n\nhaha, B       got one autocarry\n\n\n");
		autocarry.countAndInsertB();
	}
	
	@Scheduled(cron="0 0 2  * * ? ")
	public void antiDoseCount(){
		System.out.println("\n\n\nhaha, C      got one autocarry\n\n\n");
		autocarry.countAndInsertC();
	}
	
	@Scheduled(cron="0 10 2  * * ? ")
	public void antiSupplyBaseInfoCount(){
		System.out.println("\n\n\nhaha, antiSupplyBaseInfoCount      got one autocarry\n\n\n");
		autocarry.countAndInsertBaseSupplyInfo();
	}
	
}
